{include file="common:header" /}
{include file="common:side" /}
<div id="page-wrapper">
  <!-- 总数据报表管理 -- 管理员供应商列表 -->
  <!--*************************** content部分开始 ******************-->
  <div class="container-fluid" id="m_main">
    <div class="row m-t-20">
      <div class="col-sm-12">
        <div class="white-box">
          <h2 class="box-title m-b-20">管理员供应商列表</h2>
          <!-- <p class="text-muted m-b-30">Data table example</p> -->
          <div class="row">
            <div class="col-sm-3">
              <div class="form-group">
                <div class="input-group">
                  <span class="input-group-btn input-group-btn-search">
                    <i class="fa fa-search fa-blue"></i>
                  </span>
                  <input type="text" id="search_input" name="" class="form-control input-group-input-search" placeholder="请输入管理员名称" v-model="administrator_name">
                </div>
              </div>
            </div>
            <div class=" col-sm-2">
              <div class="form-group">
                <button class="btn btn-outline btn-info" @click="pageTo(1)">查询</button>
              </div>
            </div>
          </div>
          <div class="table-responsive">
            <table id="myTable" class="table table-striped color-table info-table">
              <thead>
                <tr>
                  <th>管理员</th>
                  <th>供应商</th>
                  <th>采购数据</th>
                </tr>
              </thead>
              <tbody>
                <tr v-for="(item,index) in dataList">
                  <td>{{item.administrator}}</td>
                  <td>{{item.supplier_name}}</td>
                  <td>
                    <a :href="'/home/report/administrator_statement?id='+item.id" target="_blank" title="查看详情">编辑查看</a>
                  </td>
                </tr>
              </tbody>
            </table>
            <pagination :tr-all="trAll" :page-cur="pageCur" :page-all="pageAll" :page-size="pageSize" @page-to="pageTo" ref="c1"></pagination>
          </div>
        </div>
      </div>
    </div>
    <!-- /.row -->
  </div>
  <!--*************************** content部分结束 ******************-->

  <!-- <footer class="footer text-center"> 2017 &copy; Ample Admin brought to you by themedesigner.in </footer> -->
</div>
{include file="common:js" /}
<script type="text/javascript" src="/web/js/search_list.js"></script>
{include file="common:footer" /}
{include file="component:pagination" /}

  <script type="text/javascript">
    var vm = new Vue({
      el: '#m_main',
      data() {
        return {
          searchUrl: "", //搜索接口
          draw: '', //校验字段
          administrator_name:'',//管理员名称
          dataList: [], //搜索列表数据
          trAll: 0, //数据总数
          pageAll: 0, //页码总数
          pageCur: 1, //当前页
          pageSize: 10, //每页数量
        }
      },
      mounted() {
        this.pageTo(1);
      },
      methods: {
        // 搜索当前页并渲染列表
        pageTo(page) {
          var that = this;
          var params = {
            administrator_name:that.administrator_name
          };
          searchList(that, page, params, (res) => {}, (fail) => {}, (error) => {})
        },
      }
    })
  </script>
